package lib.common.use;

import com.app.BaseActivity;
import com.app.BaseFragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;


//
public class ListActivity extends BaseActivity implements OnClickListener{

	private ListActivity activity = this;
	
	
	FrameLayout layout_content;
	Button btn_0;
	
	
///*
	@Override
	public int InitLayout() {
		// TODO Auto-generated method stub
		return R.layout.activity_list;
	}

	@Override
	public void InitView() {
		// TODO Auto-generated method stub

	
		layout_content = (FrameLayout)findViewById(R.id.layout_content);
		btn_0 = (Button)findViewById(R.id.btn_0);
		
	 
		
	}

	@Override
	public void InitListener() {
		// TODO Auto-generated method stub
 
		btn_0.setOnClickListener(this);
	}

	@Override
	public void InitProcess() {
		// TODO Auto-generated method stub

	}
//*/	
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
		int Id = v.getId();
		if(Id == R.id.btn_0){
			Select(0);
			
		}
		
			
	}

	
	
	void Select(int index){
		
		///*
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		Fragment fragment = null ;
		
		switch(index){
			case 0:
			{
				fragment = new List0Fragment();
				break;
			}
			
				
			case 1:
			{
				fragment = new List1Fragment();
				break;
			}
			
		}
		
		
		ft.replace(R.id.layout_content,  fragment);
		ft.commit();
		//*/
	}


	 
	
	

}









